package com.platform.qujia.controller;

import com.platform.qujia.pojo.vo.OilGunVO;
import com.platform.qujia.pojo.vo.StaffVO;
import com.platform.qujia.service.StaffService;
import com.platform.qujia.utils.ResultData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @date 2023/8/7
 */
@RestController
@CrossOrigin
@RequestMapping("staff")
@Api(tags = "油枪员工列表")
public class StaffController {

    @Autowired
    private StaffService staffService;

    @GetMapping("list")
    @ApiOperation("获取油枪员工列表")
    public ResultData<OilGunVO> queryStaffOilList(@RequestParam Long stationId,
                                                  @RequestParam(required = false,defaultValue = "0") Long userId){
        return ResultData.success(staffService.queryStaffOilList(stationId,userId));
    }

    @GetMapping("listWithOil")
    @ApiOperation("只获取油站员工列表(包含油品)")
    public ResultData<List<StaffVO>> queryStaffOilList(@RequestParam Long stationId){
        return ResultData.success(staffService.queryStaffList(stationId));
    }

}
